#{extends '/include/main.html' /}

<div class="search-result-zone">
	<h2 class="search-result-title">指标口径</h2>
	<div class="search-result-query-zone">
		<a href="@@{IndicatorCaliberController.form()}"  class="search-result-button search-result-new">新建</a>
		<form action="@@{IndicatorCaliberController.list()}">
			<input type="text" name="name" value="${name}"/>
			业务名称:
			<select name="businessId" >
				<option value="">请选择</option>
				#{list items : businesses, as : 'business'}
					<option value="${business.id}" #{if business.id == businessId}selected#{/if}>${business.name}</option>
				#{/list}
			</select>
			作者:
			<select name="authorId" >
				<option value="">请选择</option>
				#{list items : authors, as : 'author'}
					<option value="${author.id}" #{if author.id == authorId}selected#{/if}>${author.name}</option>
				#{/list}
			</select>
			<input type="submit" value="查询" class="search-result-button"/>
		</form>
	</div>
	<table id="search-result">
		<thead>
			<tr>
				<th>序号</th>
				<th>指标名称</th>
				<th>制表业务</th>
				<th>中文描述</th>
				<th>备注</th>
				<th>作者</th>
				<th>sql</th>
				<th>最后更新时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			#{if paged.items.size() < 1}
				#{emptyContent number:9 /}
			#{/if}
			#{else}
				#{list items : paged.items, as : 'caliber'}
					<tr>
						<td>${caliber.id}</td>
						<td>${caliber.name}</td>
						<td>${caliber.business.name}</td>
						<td>${caliber.description}</td>
						<td>${caliber.remark}</td>
						<td>${caliber.author.name}</td>
						<td>${caliber.sqlStr}</td>
						<td> #{time time :caliber.updateDate/}</td>
						<td><a href="@@{IndicatorCaliberController.form(caliber.id)}">修改</a></td>
					</tr>
				#{/list}
			#{/else}
		</tbody>
	</table>
	<div class="search-select-page-zone">
	</div>
</div>
<script>
	DwManager.renderTurnPage({
		target : $(".search-select-page-zone"),
		url : "@@{IndicatorCaliberController.list()}",
		currentPage : "${paged.currentPage}",
		totalPage : "${paged.totalPage}",
		query : {
			bussinessId : "${bussinessId}",
			name : "${name}",
			authorId : "${authorId}"
			
		}
	});
</script>